![]() |
Kinetis SDK API Reference Manual
1.0.0-beta
Freescale Semiconductor, Inc.
|
The section describes the programming interface of the UART HAL driver. More...
Data Structures | |
| struct | uart_idle_line_config_t |
| Structure for idle line configuration settings. More... | |
| struct | uart_status_flag_all_t |
| Structure for all UART status flags. More... | |
| struct | uart_interrupt_config_t |
| UART interrupt configuration structure, default settings are 0 (disabled). More... | |
| struct | uart_config_t |
| UART configuration structure. More... | |
UART Common Configurations | |
| uart_status_t | uart_hal_init (uint32_t uartInstance, const uart_config_t *config) |
| Initialize the UART controller. More... | |
| uart_status_t | uart_hal_set_baud_rate (uint32_t uartInstance, uint32_t sourceClockInHz, uint32_t desiredBaudRate) |
| Configure the UART baud rate. More... | |
| uart_status_t | uart_hal_set_baud_rate_divisor (uint32_t uartInstance, uint32_t baudRateDivisor) |
| Set the UART baud rate modulo divisor value. More... | |
| uart_status_t | uart_hal_configure_bit_count_per_char (uint32_t uartInstance, uart_bit_count_per_char_t bitCountPerChar) |
| Configure number of bits per character in the UART controller. More... | |
| void | uart_hal_configure_parity_mode (uint32_t uartInstance, uart_parity_mode_t parityModeType) |
| Configure the parity mode in the UART controller. More... | |
| uart_status_t | uart_hal_configure_stop_bit_count (uint32_t uartInstance, uart_stop_bit_count_t stopBitCount) |
| Configure the number of stop bits in the UART controller. More... | |
| void | uart_hal_configure_tx_rx_inversion (uint32_t uartInstance, uint32_t rxInvert, uint32_t txInvert) |
| Configure the transmit and receive inversion control in UART controller. More... | |
| void | uart_hal_enable_transmitter (uint32_t uartInstance) |
| Enable the UART transmitter. More... | |
| void | uart_hal_disable_transmitter (uint32_t uartInstance) |
| Disable the UART transmitter. More... | |
| bool | uart_hal_is_transmitter_enabled (uint32_t uartInstance) |
| Get the UART transmitter enabled/disabled configuration setting. More... | |
| void | uart_hal_enable_receiver (uint32_t uartInstance) |
| Enable the UART receiver. More... | |
| void | uart_hal_disable_receiver (uint32_t uartInstance) |
| Disable the UART receiver. More... | |
| bool | uart_hal_is_receiver_enabled (uint32_t uartInstance) |
| Get the UART receiver enabled/disabled configuration setting. More... | |
UART Interrupts and DMA | |
| void | uart_hal_configure_interrupts (uint32_t uartInstance, const uart_interrupt_config_t *interruptConfig) |
| Configure the UART module interrupts to enable/disable various interrupt sources. More... | |
| void | uart_hal_enable_break_detect_interrupt (uint32_t uartInstance) |
| Enable the break_detect_interrupt. More... | |
| void | uart_hal_disable_break_detect_interrupt (uint32_t uartInstance) |
| Disable the break_detect_interrupt. More... | |
| bool | uart_hal_is_break_detect_interrupt_enabled (uint32_t uartInstance) |
| Get the configuration of the break_detect_interrupt enable setting. More... | |
| void | uart_hal_enable_rx_active_edge_interrupt (uint32_t uartInstance) |
| Enable the rx_active_edge_interrupt. More... | |
| void | uart_hal_disable_rx_active_edge_interrupt (uint32_t uartInstance) |
| Disable the rx_active_edge_interrupt. More... | |
| bool | uart_hal_is_rx_active_edge_interrupt_enabled (uint32_t uartInstance) |
| Get the configuration of the rx_active_edge_interrupt enable setting. More... | |
| void | uart_hal_enable_tx_data_register_empty_interrupt (uint32_t uartInstance) |
| Enable the tx_data_register_empty_interrupt. More... | |
| void | uart_hal_disable_tx_data_register_empty_interrupt (uint32_t uartInstance) |
| Disable the tx_data_register_empty_interrupt. More... | |
| bool | uart_hal_is_tx_data_register_empty_interrupt_enabled (uint32_t uartInstance) |
| Get the configuration of the tx_data_register_empty_interrupt enable setting. More... | |
| void | uart_hal_enable_transmission_complete_interrupt (uint32_t uartInstance) |
| Enable the transmission_complete_interrupt. More... | |
| void | uart_hal_disable_transmission_complete_interrupt (uint32_t uartInstance) |
| Disable the transmission_complete_interrupt. More... | |
| bool | uart_hal_is_transmission_complete_interrupt_enabled (uint32_t uartInstance) |
| Get the configuration of the transmission_complete_interrupt enable setting. More... | |
| void | uart_hal_enable_rx_data_register_full_interrupt (uint32_t uartInstance) |
| Enable the rx_data_register_full_interrupt. More... | |
| void | uart_hal_disable_rx_data_register_full_interrupt (uint32_t uartInstance) |
| Disable the rx_data_register_full_interrupt. More... | |
| bool | uart_hal_is_receive_data_full_interrupt_enabled (uint32_t uartInstance) |
| Get the configuration of the rx_data_register_full_interrupt enable setting. More... | |
| void | uart_hal_enable_idle_line_interrupt (uint32_t uartInstance) |
| Enable the idle_line_interrupt. More... | |
| void | uart_hal_disable_idle_line_interrupt (uint32_t uartInstance) |
| Disable the idle_line_interrupt. More... | |
| bool | uart_hal_is_idle_line_interrupt_enabled (uint32_t uartInstance) |
| Get the configuration of the idle_line_interrupt enable setting. More... | |
| void | uart_hal_enable_rx_overrun_interrupt (uint32_t uartInstance) |
| Enable the rx_overrun_interrupt. More... | |
| void | uart_hal_disable_rx_overrun_interrupt (uint32_t uartInstance) |
| Disable the rx_overrun_interrupt. More... | |
| bool | uart_hal_is_rx_overrun_interrupt_enabled (uint32_t uartInstance) |
| Get the configuration of the rx_overrun_interrupt enable setting. More... | |
| void | uart_hal_enable_noise_error_interrupt (uint32_t uartInstance) |
| Enable the noise_error_interrupt. More... | |
| void | uart_hal_disable_noise_error_interrupt (uint32_t uartInstance) |
| Disable the noise_error_interrupt. More... | |
| bool | uart_hal_is_noise_error_interrupt_enabled (uint32_t uartInstance) |
| Get the configuration of the noise_error_interrupt enable setting. More... | |
| void | uart_hal_enable_framing_error_interrupt (uint32_t uartInstance) |
| Enable the framing_error_interrupt. More... | |
| void | uart_hal_disable_framing_error_interrupt (uint32_t uartInstance) |
| Disable the framing_error_interrupt. More... | |
| bool | uart_hal_is_framing_error_interrupt_enabled (uint32_t uartInstance) |
| Get the configuration of the framing_error_interrupt enable setting. More... | |
| void | uart_hal_enable_parity_error_interrupt (uint32_t uartInstance) |
| Enable the parity_error_interrupt. More... | |
| void | uart_hal_disable_parity_error_interrupt (uint32_t uartInstance) |
| Disable the parity_error_interrupt. More... | |
| bool | uart_hal_is_parity_error_interrupt_enabled (uint32_t uartInstance) |
| Get the configuration of the parity_error_interrupt enable setting. More... | |
| void | uart_hal_configure_dma (uint32_t uartInstance, bool txDmaConfig, bool rxDmaConfig) |
| Configure the UART DMA requests for the Transmitter and Receiver. More... | |
| bool | uart_hal_is_txdma_enabled (uint32_t uartInstance) |
| Get the UART Transmit DMA request configuration setting. More... | |
| bool | uart_hal_is_rxdma_enabled (uint32_t uartInstance) |
| Get the UART Receive DMA request configuration setting. More... | |
UART Transfer Functions | |
| void | uart_hal_putchar (uint32_t uartInstance, uint8_t data) |
| This function allows the user to send an 8-bit character from the UART data register. More... | |
| void | uart_hal_putchar9 (uint32_t uartInstance, uint16_t data) |
| This function allows the user to send a 9-bit character from the UART data register. More... | |
| uart_status_t | uart_hal_putchar10 (uint32_t uartInstance, uint16_t data) |
| This function allows the user to send a 10-bit character from the UART data register. More... | |
| void | uart_hal_getchar (uint32_t uartInstance, uint8_t *readData) |
| This function gets a received 8-bit character from the UART data register. More... | |
| void | uart_hal_getchar9 (uint32_t uartInstance, uint16_t *readData) |
| This function gets a received 9-bit character from the UART data register. More... | |
| uart_status_t | uart_hal_getchar10 (uint32_t uartInstance, uint16_t *readData) |
| This function gets a received 10-bit character from the UART data register. More... | |
UART Special Feature Configurations | |
| void | uart_hal_configure_wait_mode_operation (uint32_t uartInstance, uart_operation_config_t mode) |
| Configure the UART to either operate or cease to operate in WAIT mode. More... | |
| uart_operation_config_t | uart_hal_get_wait_mode_operation_config (uint32_t uartInstance) |
| Determine if the UART operates or ceases to operate in WAIT mode. More... | |
| void | uart_hal_configure_loopback_mode (uint32_t uartInstance, bool enable) |
| Configure the UART loopback operation. More... | |
| void | uart_hal_configure_singlewire_mode (uint32_t uartInstance, bool enable) |
| Configure the UART single-wire operation. More... | |
| void | uart_hal_configure_txdir_in_singlewire_mode (uint32_t uartInstance, uart_singlewire_txdir_t direction) |
| Configure the UART transmit direction while in single-wire mode. More... | |
| uart_status_t | uart_hal_put_receiver_in_standby_mode (uint32_t uartInstance) |
| Place the UART receiver in standby mode. More... | |
| void | uart_hal_put_receiver_in_normal_mode (uint32_t uartInstance) |
| Place the UART receiver in normal mode (disable standby mode operation). More... | |
| bool | uart_hal_is_receiver_in_standby (uint32_t uartInstance) |
| Determine if the UART receiver is currently in standby mode. More... | |
| void | uart_hal_select_receiver_wakeup_method (uint32_t uartInstance, uart_wakeup_method_t method) |
| Select the UART receiver wakeup method (idle-line or address-mark) from standby mode. More... | |
| uart_wakeup_method_t | uart_hal_get_receiver_wakeup_method (uint32_t uartInstance) |
| Get the UART receiver wakeup method (idle-line or address-mark) from standby mode. More... | |
| void | uart_hal_configure_idle_line_detect (uint32_t uartInstance, const uart_idle_line_config_t *config) |
| Configure the operation options of the UART idle line detect. More... | |
| void | uart_hal_set_break_char_transmit_length (uint32_t uartInstance, uart_break_char_length_t length) |
| Configure the UART break character transmit length. More... | |
| void | uart_hal_set_break_char_detect_length (uint32_t uartInstance, uart_break_char_length_t length) |
| Configure the UART break character detect length. More... | |
| void | uart_hal_queue_break_char_to_send (uint32_t uartInstance, bool enable) |
| Configure the UART transmit send break character operation. More... | |
| uart_status_t | uart_hal_configure_match_address_operation (uint32_t uartInstance, bool matchAddrMode1, bool matchAddrMode2, uint8_t matchAddrValue1, uint8_t matchAddrValue2) |
| Configure the UART match address mode control operation. More... | |
| uart_status_t | uart_hal_configure_send_msb_first_operation (uint32_t uartInstance, bool enable) |
| Configure the UART to send data MSB first (Note: Feature available on select UART instances) More... | |
| uart_status_t | uart_hal_configure_receive_resync_disable_operation (uint32_t uartInstance, bool enable) |
| Configuration option to disable the UART resynchronization during received data. More... | |
UART Status Flags | |
| void | uart_hal_get_all_status_flag (uint32_t uartInstance, uart_status_flag_all_t *allStatusFlag) |
| Get all of the UART status flag states. More... | |
| bool | uart_hal_is_transmit_data_register_empty (uint32_t uartInstance) |
| Get the UART Transmit data register empty flag. More... | |
| bool | uart_hal_is_transmission_complete (uint32_t uartInstance) |
| Get the UART Transmission complete flag. More... | |
| bool | uart_hal_is_receive_data_register_full (uint32_t uartInstance) |
| Get the UART Receive data register full flag. More... | |
| bool | uart_hal_is_idle_line_detected (uint32_t uartInstance) |
| Get the UART Idle-line detect flag. More... | |
| bool | uart_hal_is_receive_overrun_detected (uint32_t uartInstance) |
| Get the UART Receiver Overrun status flag. More... | |
| bool | uart_hal_is_noise_detected (uint32_t uartInstance) |
| Get the UART noise status flag. More... | |
| bool | uart_hal_is_frame_error_detected (uint32_t uartInstance) |
| Get the UART Frame error status flag. More... | |
| bool | uart_hal_is_parity_error_detected (uint32_t uartInstance) |
| Get the UART parity error status flag. More... | |
| bool | uart_hal_is_line_break_detected (uint32_t uartInstance) |
| Get the UART LIN break detect interrupt status flag. More... | |
| bool | uart_hal_is_receive_active_edge_detected (uint32_t uartInstance) |
| Get the UART Receive pin active edge interrupt status flag. More... | |
| bool | uart_hal_is_receiver_active (uint32_t uartInstance) |
| Get the UART Receiver Active Flag (RAF) state. More... | |
| uart_status_t | uart_hal_clear_status_flag (uint32_t uartInstance, uart_status_flag_t statusFlag) |
| Clear an individual and specific UART status flag. More... | |
| void | uart_hal_clear_all_non_autoclear_status_flags (uint32_t uartInstance) |
| Clear ALL of the UART status flags. More... | |
| struct uart_idle_line_config_t |
This structure contains settings for the UART idle line configuration such as the Idle Line Type (ILT) and the Receiver Wake Up Idle Detect (RWUID).
Data Fields | |
| unsigned | idleLineType: 1 |
| ILT, Idle bit count start: 0 - after start bit (default), 1 - after stop bit. | |
| unsigned | rxWakeIdleDetect: 1 |
| RWUID, Receiver Wake Up Idle Detect. More... | |
| unsigned uart_idle_line_config_t::rxWakeIdleDetect |
IDLE status bit operation during receive standby. Controls whether idle character that wakes up receiver will also set IDLE status bit 0 - IDLE status bit doesn't get set (default), 1 - IDLE status bit gets set
| struct uart_status_flag_all_t |
This structure contains the settings for all of the UART status flags.
Data Fields | |
| unsigned | transmitDataRegisterEmpty: 1 |
| Transmit data register empty flag, sets when transmit buffer is empty. | |
| unsigned | transmissionComplete: 1 |
| Transmission complete flag, sets when transmitter is idle (transmission activity complete) | |
| unsigned | receiveDataRegisterFull: 1 |
| Receive data register full flag, sets when the receive data buffer is full. | |
| unsigned | idleLineDetect: 1 |
| Idle line detect flag, sets when idle line detected. | |
| unsigned | receiveOverrun: 1 |
| Receiver Overrun, sets when new data is received before data is read from receive register. | |
| unsigned | noiseDetect: 1 |
| Receiver takes 3 samples of each received bit. More... | |
| unsigned | frameError: 1 |
| Frame error flag, sets if logic 0 was detected where stop bit expected. | |
| unsigned | parityError: 1 |
| If parity enabled, will set upon parity error detection. | |
| unsigned | lineBreakDetect: 1 |
| LIN break detect interrupt flag, sets when LIN break char detected and LIN circuit enabled. | |
| unsigned | receiveActiveEdgeDetect: 1 |
| Receive pin active edge interrupt flag, sets when active edge detected. | |
| unsigned | receiverActive: 1 |
| Receiver Active Flag (RAF), sets at beginning of valid start bit. | |
| unsigned uart_status_flag_all_t::noiseDetect |
If any of these samples differ, noise flag sets
| struct uart_interrupt_config_t |
This structure contains the settings for all of the UART interrupt configurations.
Data Fields | |
| unsigned | linBreakDetect: 1 |
| LIN break detect: 0 - disable interrupt, 1 - enable interrupt. | |
| unsigned | rxActiveEdge: 1 |
| RX Active Edge: 0 - disable interrupt, 1 - enable interrupt. | |
| unsigned | transmitDataRegisterEmpty: 1 |
| Transmit data register empty: 0 - disable interrupt, 1 - enable interrupt. | |
| unsigned | transmitComplete: 1 |
| Transmission complete: 0 - disable interrupt, 1 - enable interrupt. | |
| unsigned | receiverDataRegisterFull: 1 |
| Receiver data register full: 0 - disable interrupt, 1 - enable interrupt. | |
| unsigned | idleLine: 1 |
| Idle line: 0 - disable interrupt, 1 - enable interrupt. | |
| unsigned | receiverOverrun: 1 |
| Receiver Overrun: 0 - disable interrupt, 1 - enable interrupt. | |
| unsigned | noiseErrorFlag: 1 |
| Noise error flag: 0 - disable interrupt, 1 - enable interrupt. | |
| unsigned | frameErrorFlag: 1 |
| Framing error flag: 0 - disable interrupt, 1 - enable interrupt. | |
| unsigned | parityErrorFlag: 1 |
| Parity error flag: 0 - disable interrupt, 1 - enable interrupt. | |
| struct uart_config_t |
This structure contains the settings for the most common UART configurations including the UART module source clock, baud rate, parity mode, stop bit count, data bit count per character, and tx/rx inversion options (which is the least common of the configurations).
Data Fields | |
| uint32_t | uartSourceClockInHz |
| UART module source clock in Hz. | |
| uint32_t | baudRate |
| UART baud rate. | |
| uart_parity_mode_t | parityMode |
| Parity mode, disabled (default), even, or odd. | |
| uart_stop_bit_count_t | stopBitCount |
| Number of stop bits, 1 stop bit (default) or 2 stop bits. | |
| uart_bit_count_per_char_t | bitCountPerChar |
| Number of bits, 8-bit (default) or 9-bit in a word (up to 10-bits in some UART instances) | |
| unsigned | rxDataInvert: 1 |
| Receive Data Inversion: 0 - not inverted (default), 1 - inverted. | |
| unsigned | txDataInvert: 1 |
| Transmit Data Inversion: 0 - not inverted (default), 1 - inverted. | |
| enum uart_status_t |
| enum uart_parity_mode_t |
These constants define the number of allowable data bits per UART character. Note, check the UART documentation to determine if the desired UART instance supports the desired number of data bits per UART character.
| Enumerator | |
|---|---|
| kUart8BitsPerChar |
8-bit data characters |
| kUart9BitsPerChar |
9-bit data characters |
| kUart10BitsPerChar |
10-bit data characters |
| enum uart_wakeup_method_t |
This provides constants for the UART break character length for both transmission and detection purposes. Note that the actual maximum bit times may vary depending on the UART instance.
| enum uart_status_flag_t |
This provides constants for the UART status flags for use in the UART functions.
| uart_status_t uart_hal_init | ( | uint32_t | uartInstance, |
| const uart_config_t * | config | ||
| ) |
This function initializes the module to user defined settings and default settings. Here is an example demonstrating how to define the uart_config_t structure and call the uart_hal_init function:
| uartInstance | UART module instance number. |
| config | UART configuration data. |
| uart_status_t uart_hal_set_baud_rate | ( | uint32_t | uartInstance, |
| uint32_t | sourceClockInHz, | ||
| uint32_t | desiredBaudRate | ||
| ) |
This function programs the UART baud rate to the desired value passed in by the user. The user must also pass in the module source clock so that the function can calculate the baud rate divisors to their appropriate values. In some UART instances it is required that the transmitter/receiver be disabled before calling this function. Generally this is applied to all UARTs to ensure safe operation.
| uartInstance | UART module instance number. |
| sourceClockInHz | UART source input clock in Hz. |
| desiredBaudRate | UART desired baud rate. |
| uart_status_t uart_hal_set_baud_rate_divisor | ( | uint32_t | uartInstance, |
| uint32_t | baudRateDivisor | ||
| ) |
This function allows the user to program the baud rate divisor directly in situations where the divisor value is known. In this case, the user may not want to call the uart_hal_set_baud_rate() function, as the divisor is already known.
| uartInstance | UART module instance number. |
| baudRateDivisor | The baud rate modulo division "SBR" value. |
| uart_status_t uart_hal_configure_bit_count_per_char | ( | uint32_t | uartInstance, |
| uart_bit_count_per_char_t | bitCountPerChar | ||
| ) |
This function allows the user to configure the number of bits per character according to the typedef uart_bit_count_per_char_t. In some UART instances it is required that the transmitter/receiver be disabled before calling this function. This may be applied to all UARTs to ensure safe operation.
| uartInstance | UART module instance number. |
| bitCountPerChar | Number of bits per char (8, 9, or 10, depending on the UART instance). |
| void uart_hal_configure_parity_mode | ( | uint32_t | uartInstance, |
| uart_parity_mode_t | parityModeType | ||
| ) |
This function allows the user to configure the parity mode of the UART controller to disable it or enable it for even parity or for odd parity. In some UART instances it is required that the transmitter/receiver be disabled before calling this function. This may be applied to all UARTs to ensure safe operation.
| uartInstance | UART module instance number. |
| parityModeType | Parity mode setting (enabled, disable, odd, even - see parity_mode_t struct). |
| uart_status_t uart_hal_configure_stop_bit_count | ( | uint32_t | uartInstance, |
| uart_stop_bit_count_t | stopBitCount | ||
| ) |
This function allows the user to configure the number of stop bits in the UART controller to be one or two stop bits. In some UART instances it is required that the transmitter/receiver be disabled before calling this function. This may be applied to all UARTs to ensure safe operation.
| uartInstance | UART module instance number. |
| stopBitCount | Number of stop bits setting (1 or 2 - see uart_stop_bit_count_t struct). |
| void uart_hal_configure_tx_rx_inversion | ( | uint32_t | uartInstance, |
| uint32_t | rxInvert, | ||
| uint32_t | txInvert | ||
| ) |
This function allows the user to invert the transmit and receive signals, independently. This function should only be called when the UART is between transmit and receive packets.
| uartInstance | UART module instance number. |
| rxInvert | Enable (1) or disable (0) receive inversion. |
| txInvert | Enable (1) or disable (0) transmit inversion. |
| void uart_hal_enable_transmitter | ( | uint32_t | uartInstance | ) |
This function allows the user to enable the UART transmitter.
| uartInstance | UART module instance number. |
| void uart_hal_disable_transmitter | ( | uint32_t | uartInstance | ) |
This function allows the user to disable the UART transmitter.
| uartInstance | UART module instance number. |
| bool uart_hal_is_transmitter_enabled | ( | uint32_t | uartInstance | ) |
This function allows the user to get the setting of the UART transmitter.
| uartInstance | UART module instance number. |
| void uart_hal_enable_receiver | ( | uint32_t | uartInstance | ) |
This function allows the user to enable the UART receiver.
| uartInstance | UART module instance number. |
| void uart_hal_disable_receiver | ( | uint32_t | uartInstance | ) |
This function allows the user to disable the UART receiver.
| uartInstance | UART module instance number. |
| bool uart_hal_is_receiver_enabled | ( | uint32_t | uartInstance | ) |
This function allows the user to get the setting of the UART receiver.
| uartInstance | UART module instance number. |
| void uart_hal_configure_interrupts | ( | uint32_t | uartInstance, |
| const uart_interrupt_config_t * | interruptConfig | ||
| ) |
This function allows the user to configure all of the UART interrupts with one function call. The user will first need to initialize and pass in a structure of type uart_interrupt_config_t which sets the configuration of each interrupt.
| uartInstance | UART module instance number. |
| interruptConfig | UART interrupt configuration data. |
| void uart_hal_enable_break_detect_interrupt | ( | uint32_t | uartInstance | ) |
| uartInstance | UART module instance number. |
| void uart_hal_disable_break_detect_interrupt | ( | uint32_t | uartInstance | ) |
| uartInstance | UART module instance number. |
| bool uart_hal_is_break_detect_interrupt_enabled | ( | uint32_t | uartInstance | ) |
| uartInstance | UART module instance number. |
| void uart_hal_enable_rx_active_edge_interrupt | ( | uint32_t | uartInstance | ) |
| uartInstance | UART module instance number. |
| void uart_hal_disable_rx_active_edge_interrupt | ( | uint32_t | uartInstance | ) |
| uartInstance | UART module instance number. |
| bool uart_hal_is_rx_active_edge_interrupt_enabled | ( | uint32_t | uartInstance | ) |
| uartInstance | UART instance number. |
| void uart_hal_enable_tx_data_register_empty_interrupt | ( | uint32_t | uartInstance | ) |
| uartInstance | UART module instance number. |
| void uart_hal_disable_tx_data_register_empty_interrupt | ( | uint32_t | uartInstance | ) |
| uartInstance | UART module instance number. |
| bool uart_hal_is_tx_data_register_empty_interrupt_enabled | ( | uint32_t | uartInstance | ) |
| uartInstance | UART module instance number. |
| void uart_hal_enable_transmission_complete_interrupt | ( | uint32_t | uartInstance | ) |
| uartInstance | UART module instance number. |
| void uart_hal_disable_transmission_complete_interrupt | ( | uint32_t | uartInstance | ) |
| uartInstance | UART module instance number. |
| bool uart_hal_is_transmission_complete_interrupt_enabled | ( | uint32_t | uartInstance | ) |
| uartInstance | UART module instance number. |
| void uart_hal_enable_rx_data_register_full_interrupt | ( | uint32_t | uartInstance | ) |
| uartInstance | UART module instance number. |
| void uart_hal_disable_rx_data_register_full_interrupt | ( | uint32_t | uartInstance | ) |
| uartInstance | UART module instance number. |
| bool uart_hal_is_receive_data_full_interrupt_enabled | ( | uint32_t | uartInstance | ) |
| uartInstance | UART module instance number. |
| void uart_hal_enable_idle_line_interrupt | ( | uint32_t | uartInstance | ) |
| uartInstance | UART module instance number. |
| void uart_hal_disable_idle_line_interrupt | ( | uint32_t | uartInstance | ) |
| uartInstance | UART module instance number. |
| bool uart_hal_is_idle_line_interrupt_enabled | ( | uint32_t | uartInstance | ) |
| uartInstance | UART module instance number. |
| void uart_hal_enable_rx_overrun_interrupt | ( | uint32_t | uartInstance | ) |
| uartInstance | UART module instance number. |
| void uart_hal_disable_rx_overrun_interrupt | ( | uint32_t | uartInstance | ) |
| uartInstance | UART module instance number. |
| bool uart_hal_is_rx_overrun_interrupt_enabled | ( | uint32_t | uartInstance | ) |
| uartInstance | UART module instance number. |
| void uart_hal_enable_noise_error_interrupt | ( | uint32_t | uartInstance | ) |
| uartInstance | UART module instance number. |
| void uart_hal_disable_noise_error_interrupt | ( | uint32_t | uartInstance | ) |
| uartInstance | UART module instance number. |
| bool uart_hal_is_noise_error_interrupt_enabled | ( | uint32_t | uartInstance | ) |
| uartInstance | UART module instance number. |
| void uart_hal_enable_framing_error_interrupt | ( | uint32_t | uartInstance | ) |
| uartInstance | UART module instance number. |
| void uart_hal_disable_framing_error_interrupt | ( | uint32_t | uartInstance | ) |
| uartInstance | UART module instance number. |
| bool uart_hal_is_framing_error_interrupt_enabled | ( | uint32_t | uartInstance | ) |
| uartInstance | UART module instance number. |
| void uart_hal_enable_parity_error_interrupt | ( | uint32_t | uartInstance | ) |
| uartInstance | UART module instance number. |
| void uart_hal_disable_parity_error_interrupt | ( | uint32_t | uartInstance | ) |
| uartInstance | UART module instance number. |
| bool uart_hal_is_parity_error_interrupt_enabled | ( | uint32_t | uartInstance | ) |
| uartInstance | UART module instance number. |
| void uart_hal_configure_dma | ( | uint32_t | uartInstance, |
| bool | txDmaConfig, | ||
| bool | rxDmaConfig | ||
| ) |
This function allows the user to configure the transmit data register empty flag to generate an interrupt request (default) or a DMA request. Similarly, this function allows the user to configure the receive data register full flag to generate an interrupt request (default) or a DMA request.
| uartInstance | UART module instance number. |
| txDmaConfig | Transmit DMA request configuration setting (enable: true /disable: false). |
| rxDmaConfig | Receive DMA request configuration setting (enable: true/disable: false). |
| bool uart_hal_is_txdma_enabled | ( | uint32_t | uartInstance | ) |
This function returns the configuration setting of the Transmit DMA request.
| uartInstance | UART module instance number. |
| bool uart_hal_is_rxdma_enabled | ( | uint32_t | uartInstance | ) |
This function returns the configuration setting of the Receive DMA request.
| uartInstance | UART module instance number. |
| void uart_hal_putchar | ( | uint32_t | uartInstance, |
| uint8_t | data | ||
| ) |
| uartInstance | UART module instance number. |
| data | The data to send of size 8-bit. |
| void uart_hal_putchar9 | ( | uint32_t | uartInstance, |
| uint16_t | data | ||
| ) |
| uartInstance | UART module instance number. |
| data | The data to send of size 9-bit. |
| uart_status_t uart_hal_putchar10 | ( | uint32_t | uartInstance, |
| uint16_t | data | ||
| ) |
(Note: Feature available on select UART instances)
| uartInstance | UART module instance number. |
| data | The data to send of size 10-bit. |
| void uart_hal_getchar | ( | uint32_t | uartInstance, |
| uint8_t * | readData | ||
| ) |
| uartInstance | UART module instance number. |
| readData | The received data read from data register of size 8-bit. |
| void uart_hal_getchar9 | ( | uint32_t | uartInstance, |
| uint16_t * | readData | ||
| ) |
| uartInstance | UART module instance number. |
| readData | The received data read from data register of size 9-bit. |
| uart_status_t uart_hal_getchar10 | ( | uint32_t | uartInstance, |
| uint16_t * | readData | ||
| ) |
(Note: Feature available on select UART instances)
| uartInstance | UART module instance number. |
| readData | The received data read from data register of size 10-bit. |
| void uart_hal_configure_wait_mode_operation | ( | uint32_t | uartInstance, |
| uart_operation_config_t | mode | ||
| ) |
The function configures the UART to either operate or cease to operate when WAIT mode is entered. In some UART instances it is required that the transmitter/receiver be disabled before calling this function. This may be applied to all UARTs to ensure safe operation.
| uartInstance | UART module instance number. |
| mode | The UART WAIT mode operation - operates or ceases to operate in WAIT mode. |
| uart_operation_config_t uart_hal_get_wait_mode_operation_config | ( | uint32_t | uartInstance | ) |
This function returns kUartOperates if the UART has been configured to operate in WAIT mode. Else it returns KUartStops if the UART has been configured to cease-to-operate in WAIT mode.
| uartInstance | UART module instance number. |
| void uart_hal_configure_loopback_mode | ( | uint32_t | uartInstance, |
| bool | enable | ||
| ) |
This function enables or disables the UART loopback operation. In some UART instances it is required that the transmitter/receiver be disabled before calling this function. This may be applied to all UARTs to ensure safe operation.
| uartInstance | UART module instance number. |
| enable | The UART loopback mode configuration, either disabled (false) or enabled (true). |
| void uart_hal_configure_singlewire_mode | ( | uint32_t | uartInstance, |
| bool | enable | ||
| ) |
This function enables or disables the UART single-wire operation. In some UART instances it is required that the transmitter/receiver be disabled before calling this function. This may be applied to all UARTs to ensure safe operation.
| uartInstance | UART module instance number. |
| enable | The UART single-wire mode configuration, either disabled (false) or enabled (true). |
| void uart_hal_configure_txdir_in_singlewire_mode | ( | uint32_t | uartInstance, |
| uart_singlewire_txdir_t | direction | ||
| ) |
This function configures the transmitter direction when the UART is configured for single-wire operation.
| uartInstance | UART module instance number. |
| direction | The UART single-wire mode transmit direction configuration of type uart_singlewire_txdir_t (either kUartSinglewireTxdirIn or kUartSinglewireTxdirOut. |
| uart_status_t uart_hal_put_receiver_in_standby_mode | ( | uint32_t | uartInstance | ) |
This function, when called, places the UART receiver into standby mode. In some UART instances, there are conditions that must be met before placing rx in standby mode. Before placing UART in standby, determine if receiver is set to wake on idle, and if receiver is already in idle state. NOTE: RWU should only be set with C1[WAKE] = 0 (wakeup on idle) if the channel is currently not idle. This can be determined by the S2[RAF] flag. If set to wake up FROM an IDLE event and the channel is already idle, it is possible that the UART will discard data because data must be received (or a LIN break detect) after an IDLE is detected before IDLE is allowed to be reasserted.
| uartInstance | UART module instance number. |
| void uart_hal_put_receiver_in_normal_mode | ( | uint32_t | uartInstance | ) |
This function, when called, places the UART receiver into normal mode and out of standby mode.
| uartInstance | UART module instance number. |
| bool uart_hal_is_receiver_in_standby | ( | uint32_t | uartInstance | ) |
This function determines the state of the UART receiver. If it returns true, this means that the UART receiver is in standby mode; if it returns false, the UART receiver is in normal mode.
| uartInstance | UART module instance number. |
| void uart_hal_select_receiver_wakeup_method | ( | uint32_t | uartInstance, |
| uart_wakeup_method_t | method | ||
| ) |
This function configures the wakeup method of the UART receiver from standby mode. The options are idle-line wake or address-mark wake.
| uartInstance | UART module instance number. |
| method | The UART receiver wakeup method options: kUartIdleLineWake - Idle-line wake or kUartAddrMarkWake - address-mark wake. |
| uart_wakeup_method_t uart_hal_get_receiver_wakeup_method | ( | uint32_t | uartInstance | ) |
This function returns how the UART receiver is configured to wake from standby mode. The wake method options that can be returned are kUartIdleLineWake or kUartAddrMarkWake.
| uartInstance | UART module instance number. |
| void uart_hal_configure_idle_line_detect | ( | uint32_t | uartInstance, |
| const uart_idle_line_config_t * | config | ||
| ) |
This function allows the user to configure the UART idle-line detect operation. There are two separate operations for the user to configure, the idle line bit-count start and the receive wake up affect on IDLE status bit. The user will pass in a structure of type uart_idle_line_config_t. In some UART instances it is required that the transmitter/receiver be disabled before calling this function. This may be applied to all UARTs to ensure safe operation.
| uartInstance | UART module instance number. |
| config | The UART configuration pointer to the structure for idle-line detect operation of type uart_idle_line_config_t. |
| void uart_hal_set_break_char_transmit_length | ( | uint32_t | uartInstance, |
| uart_break_char_length_t | length | ||
| ) |
This function allows the user to configure the UART break character transmit length. Refer to the typedef uart_break_char_length_t for setting options. In some UART instances it is required that the transmitter be disabled before calling this function. This may be applied to all UARTs to ensure safe operation.
| uartInstance | UART module instance number. |
| length | The UART break character length setting of type uart_break_char_length_t, either a minimum 10-bit times or a minimum 13-bit times. |
| void uart_hal_set_break_char_detect_length | ( | uint32_t | uartInstance, |
| uart_break_char_length_t | length | ||
| ) |
This function allows the user to configure the UART break character detect length. Refer to the typedef uart_break_char_length_t for setting options.
| uartInstance | UART module instance number. |
| length | The UART break character length setting of type uart_break_char_length_t, either a minimum 10-bit times or a minimum 13-bit times. |
| void uart_hal_queue_break_char_to_send | ( | uint32_t | uartInstance, |
| bool | enable | ||
| ) |
This function allows the user to queue a UART break character to send. If true is passed into the function, then a break character is queued for transmission. A break character will continuously be queued until this function is called again when a false is passed into this function.
| uartInstance | UART module instance number. |
| enable | If false, the UART normal/queue break character setting is disabled, which configures the UART for normal transmitter operation. If true, a break character is queued for transmission. |
| uart_status_t uart_hal_configure_match_address_operation | ( | uint32_t | uartInstance, |
| bool | matchAddrMode1, | ||
| bool | matchAddrMode2, | ||
| uint8_t | matchAddrValue1, | ||
| uint8_t | matchAddrValue2 | ||
| ) |
(Note: Feature available on select UART instances)
The function allows the user to configure the UART match address control operation. The user has the option to enable the match address mode and to program the match address value. There are two match address modes, each with its own enable and programmable match address value.
| uartInstance | UART module instance number. |
| matchAddrMode1 | If true, this enables match address mode 1 (MAEN1), where false disables. |
| matchAddrMode2 | If true, this enables match address mode 2 (MAEN2), where false disables. |
| matchAddrValue1 | The match address value to program for match address mode 1. |
| matchAddrValue2 | The match address value to program for match address mode 2. |
| uart_status_t uart_hal_configure_send_msb_first_operation | ( | uint32_t | uartInstance, |
| bool | enable | ||
| ) |
The function allows the user to configure the UART to send data MSB first or LSB first. In some UART instances it is required that the transmitter/receiver be disabled before calling this function. This may be applied to all UARTs to ensure safe operation.
| uartInstance | UART module instance number. |
| enable | This configures send MSB first mode configuration. If true, the data is sent MSB first; if false, it is sent LSB first. |
| uart_status_t uart_hal_configure_receive_resync_disable_operation | ( | uint32_t | uartInstance, |
| bool | enable | ||
| ) |
(Note: Feature available on select UART instances)
This function allows the user to disable the UART resync of received data. The default setting is false, meaning that resynchronization during the received data word is supported. If the user passes in true, this disables resynchronization during the received data word.
| uartInstance | UART module instance number. |
| enable | If false, then resynchronization during the received data word is supported. If true, resynchronization during the received data word is disabled. |
| void uart_hal_get_all_status_flag | ( | uint32_t | uartInstance, |
| uart_status_flag_all_t * | allStatusFlag | ||
| ) |
This function gets all of the UART status flag states and places into a structure of type uart_status_flag_all_t. The user must pass in a pointer to this structure.
| uartInstance | UART module instance number. |
| allStatusFlag | Pointer to the structure of all the UART status flags states. |
| bool uart_hal_is_transmit_data_register_empty | ( | uint32_t | uartInstance | ) |
This function returns the state of the UART Transmit data register empty flag.
| uartInstance | UART module instance number. |
| bool uart_hal_is_transmission_complete | ( | uint32_t | uartInstance | ) |
This function returns the state of the UART Transmission complete flag.
| uartInstance | UART module instance number. |
| bool uart_hal_is_receive_data_register_full | ( | uint32_t | uartInstance | ) |
This function returns the state of the UART Receive data register full flag.
| uartInstance | UART module instance number. |
| bool uart_hal_is_idle_line_detected | ( | uint32_t | uartInstance | ) |
This function returns the state of the UART Idle-line detect flag.
| uartInstance | UART module instance number. |
| bool uart_hal_is_receive_overrun_detected | ( | uint32_t | uartInstance | ) |
This function returns the state of the the UART Receiver Overrun status flag.
| uartInstance | UART module instance number. |
| bool uart_hal_is_noise_detected | ( | uint32_t | uartInstance | ) |
This function returns the state of the UART noise status flag.
| uartInstance | UART module instance number. |
| bool uart_hal_is_frame_error_detected | ( | uint32_t | uartInstance | ) |
This function returns the state of the UART Frame error status flag.
| uartInstance | UART module instance number. |
| bool uart_hal_is_parity_error_detected | ( | uint32_t | uartInstance | ) |
This function returns the state of the UART parity error status flag.
| uartInstance | UART module instance number. |
| bool uart_hal_is_line_break_detected | ( | uint32_t | uartInstance | ) |
This function returns the state of the UART LIN break detect interrupt status flag.
| uartInstance | UART module instance number. |
| bool uart_hal_is_receive_active_edge_detected | ( | uint32_t | uartInstance | ) |
This function returns the state of the UART Receive pin active edge interrupt status flag.
| uartInstance | UART module instance number. |
| bool uart_hal_is_receiver_active | ( | uint32_t | uartInstance | ) |
This function returns the state of the UART Receiver Active Flag (RAF).
| uartInstance | UART module instance number. |
| uart_status_t uart_hal_clear_status_flag | ( | uint32_t | uartInstance, |
| uart_status_flag_t | statusFlag | ||
| ) |
This function allows the user to clear an individual and specific UART status flag. Refer to structure definition uart_status_flag_t for list of status bits.
| uartInstance | UART module instance number. |
| statusFlag | The desired UART status flag to clear. |
| void uart_hal_clear_all_non_autoclear_status_flags | ( | uint32_t | uartInstance | ) |
This function tries to clear all of the UART status flags. In some cases, some of the status flags may not get cleared because the condition that set the flag may still exist.
| uartInstance | UART module instance number. |